<?= flash() ?? ''; ?>

<div class="breadcrumb d-flex align-items-center px-3 js-scroll">
    <?php if(session('user_id')): ?>
        <div class="btn btn-icon me-3 hidden-lg hidden-md hidden-sm" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNav" aria-controls="offcanvasNav">
            <i class="iconfont icon-user"></i>
        </div>
    <?php else: ?>
        <a role="button" class="btn btn-icon me-3 hidden-lg hidden-md hidden-sm" href="/user-login">
            <i class="iconfont icon-user"></i>
        </a>
    <?php endif; ?>
    <div class="btn btn-icon me-4 js-back" aria-label="返回" role="button" tabindex="0">
        <i class="iconfont icon-left-arrow fs-20"></i>
    </div>
    <h2 class="w-100 fs-18 hand js-top"><?= $page_title ?? ''; ?></h2>
    <div class="search-input">
        <input aria-label="搜索表单" class="form-control" type="search" placeholder="搜索">
    </div>
</div>

<nav class="nav nav-justified border-bottom">
    <a class="nav-link" href="/" data-active="my-post">热门</a>
    <a class="nav-link" href="/explore/media" data-active="my-follow">媒体</a>
    <a class="nav-link" href="/explore/user" data-active="my-follow">用户</a>
    <a class="nav-link" href="/user/follow" data-active="my-follow">群</a>
</nav>

<script>
    // 确保DOM加载完毕
    document.addEventListener('DOMContentLoaded', () => {
        highlightActiveLink('explore');
        highlightActiveLink('my-post');
    });
    
</script>